#include <stdio.h>
#include <stdlib.h>
#include "dominion.h"

void testing(struct gameState *game);

int main(int argc, char *argv[]){
	struct gameState *game = malloc(sizeof(struct gameState));
	testing(game);
	free(game);
	return 0;
}

void testing(struct gameState *game){
	struct gameState *after = malloc(sizeof(struct gameState));
	int h_size = 0;
	
	int i;
	for(i = 0; i < 10; i ++){
		h_size = (rand() % 10) + 5;//Determine random hand size
		int j;
		for(j = 0; j < h_size; j++){//Deal Hand
			game->deck[0][j] = rand() % 35;
			game->deckCount[0]++;
		}
		memcpy(after, game, sizeof(struct gameState));
		scoreFor(i, game);//checks players hand and tallies score
		printf("Hand Size = %d\n", h_size);
		int compare = memcmp(game, after, sizeof(struct gameState));
		if(compare == 0){
			printf("Unit Test 3 Failed, no change.\n");
		}
		else{
			printf("Unit Test 3 (Before/After) test Passed gameState adjusted.\n");
		}
	}
	free(after);
	return;
}